package io.example.web;

import io.example.entity.Book;
import io.example.repository.BookRepository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: RestController .<br>
 * <p>Created Time: 2020/10/22 15:57 </p>
 *
 * @author <a href="mail to: mengxiangyuancc@gmail.com" rel="nofollow">孟祥元</a>
 */
@RestController
public class SpringRestController {

    @Autowired BookRepository bookRepository;

    @GetMapping("books")
    public List<Book> findAll() {
        return bookRepository.findAll();
    }
}
